﻿'use strict'; 

/*
ERPStore Application
*/

var erpstore = angular.module('erpstore', [
    'ngResource',
    'ngCookies',
    'ui.bootstrap',
    'ui.keypress',
    'WebApiServices'
]);

erpstore.config(['$locationProvider', function ($locationProvider) {
    $locationProvider.html5Mode(false).hashPrefix('!');
}]);

erpstore.config(['$routeProvider', function ($routeProvider) {
    $routeProvider.
        when('/home', {
            templateUrl: '/ngviews/home/index.htm',
            controller: HomeController
        }).
        when('/category/:link', {
            templateUrl: '/ngviews/catalog/category.html',
            controller: CategoryController
        }).
        when('/product/:code/:link', {
            templateUrl: '/ngviews/catalog/product.html',
            controller: ProductController
        }).
        when('/cart/view/:cartCode', {
            templateUrl: '/ngviews/cart/index.html',
            controller: CartController
        }).
        when('/search/:query', {
            templateUrl: '/ngviews/catalog/searchresult.html',
            controller: SearchController
        }).
        otherwise({
            redirectTo: '/home'
        });
}]);

erpstore.directive('price', function () {
    return {
        restrict: 'E',
        scope: {
            value: '@'
        },
        replace: false,
        templateUrl: '/ngviews/shared/_price.html'
    };
});




